home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / Aminet / comm / tcp / hserv.lha / hserv / cgi-bin / counter.rexx < prev    next >
OS/2 REXX Batch file  |  1999-05-24  |  763b  |  48 lines

  1. /* */
  2.  
  3. parse arg "df="file"&"dummy
  4. call pragma("D",AddPart(GetClip("hserv_DocumentDir"),GetClip("hserv_CgiDir")))
  5.  
  6. path=GetClip("hserv_DocumentDir")
  7. complete=AddPart(path,file)
  8.  
  9. n=0
  10. if ~Open("IN",complete,'R') then
  11.     if ~Open("IN",complete,'W') then return ""
  12.     else call writech("IN",0)
  13. else n=ReadLn("IN")
  14. call close("IN")
  15.  
  16. if ~Datatype(n,'N') then n=0
  17. else if n<0 then n=0
  18. if ~Open("IN",complete,'W') then return ""
  19. n=n+1
  20. call WriteCH("IN",n)
  21. call close("IN")
  22.  
  23. mkstrip
  24.  
  25. d.0="zero"
  26. d.1="one"
  27. d.2="two"
  28. d.3="three"
  29. d.4="four"
  30. d.5="five"
  31. d.6="six"
  32. d.7="seven"
  33. d.8="eight"
  34. d.9="nine"
  35.  
  36. a=""
  37. if n=0 then a="zero.gif"
  38. else
  39.     do while n~=0
  40.         i=n//10
  41.         a="digits/"d.i || ".gif" a
  42.         n=n%10
  43.     end
  44.  
  45. say "Content-Type: text/html";say
  46. cmd = "digits/mkstrip" a
  47. shell COMMAND cmd
  48.